package options

import (
	"cs0512/fmr/internal/pkg/server"

	"github.com/marmotedu/log"
)

type Options struct {
	GenericServerRunOptions *ServerRunOptions       `json:"server"    mapstructure:"genericServer"   yaml:"genericServer"`
	InsecureServing         *InsecureServingOptions `json:"insecure" mapstructure:"insecure" yaml:"insecure"`
	SecureServing           *SecureServingOptions   `json:"secure"   mapstructure:"secure" yaml:"secure"`
	MySQLOptions            *MySQLOptions           `json:"mysql"    mapstructure:"mysql" yaml:"mysql"`
	Log                     *log.Options            `json:"log"      mapstructure:"log"`
	GRPCOptions             *GRPCOptions            `json:"grpc" mapstructure:"grpc"`
}

func NewOptions() *Options {
	o := &Options{
		GenericServerRunOptions: NewServerRunOptions(),
		InsecureServing:         NewInsecureServingOptions(),
		SecureServing:           NewSecureServingOptions(),
		MySQLOptions:            NewMySQLOptions(),
		Log:                     NewLogOpton(),
		GRPCOptions:             NewGRPCOptions(),
	}
	return o
}

// ApplyTo applies the run options to the method receiver and returns self.
func (o *Options) ApplyTo(c *server.Config) error {
	return nil
}

func (o *Options) Complete() error {
	return nil
}
